package bu.met.cs664;

/**
 * Direction on the board
 */
public enum Direction {
    NORTH,
    EAST,
    SOUTH,
    WEST;

    public static Direction turnRight(Direction d) {
        switch (d) {
            case NORTH: return EAST;
            case EAST: return SOUTH;
            case SOUTH: return WEST;
            case WEST: return NORTH;
            default: return null;
        }
    }

    public static Direction turnLeft(Direction d) {
        switch (d) {
            case NORTH: return WEST;
            case EAST: return NORTH;
            case SOUTH: return EAST;
            case WEST: return SOUTH;
            default: return null;
        }
    }
    
    public static Direction getDirectionOfAction(Actions a) {
    	switch (a) {
    		case MOVE_NORTH: return NORTH;
    		case MOVE_WEST: return WEST;
    		case MOVE_SOUTH: return SOUTH;
    		case MOVE_EAST: return EAST;
    		case SHOOT_NORTH: return NORTH;
    		case SHOOT_WEST: return WEST;
    		case SHOOT_SOUTH: return SOUTH;
    		case SHOOT_EAST: return EAST;
    		default: return null;
    	}
    }
}
